﻿using System;
using System.Diagnostics;
using log4net;
using log4net.Config;

namespace AsyncLoggers.Log4net.Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            XmlConfigurator.Configure();
            ILog logger = LogManager.GetLogger("Logger");

            Stopwatch sw = Stopwatch.StartNew();

            for (int i = 0; i < 1000; i++)
            {
                logger.Info("Hi guys.");
            }

            Console.WriteLine("Spent the following time logging: " + sw.Elapsed);

            Console.ReadLine();

            ILog asyncLogger = LogManager.GetLogger("AsyncLogger");

            var sw2 = Stopwatch.StartNew();

            for (int i = 0; i < 1000; i++)
            {
                asyncLogger.Info("Hi guys.");
            }

            sw2.Stop();

            Console.ReadLine();

            Console.WriteLine("Spend the following time logging: " + sw2.Elapsed);

            Console.ReadLine();
        }
    }
}